package selenium;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import registrationSteps.TestSteps;
import utils.ReportWriter;


public class Hometask4 extends TestSteps {

    @DataProvider(name = "successTestData")
    public Object[][] createSuccessTestData() {
        return new Object[][] {
                { "http://rozetka.com.ua/","userName1XX","userName1XX@gamil.com","qwerty" }
        };
    }

    @DataProvider(name = "failedTestData")
    public Object[][] createFailedTestData() {
        return new Object[][] {
                { "http://rozetka.com.ua/", "userName1234", "userName1234@gamil.com","1234qwerty" },
                { "http://rozetka.com.ua/", "userName1234", "userName1234","1234qwerty" },
                { "http://rozetka.com.ua/", "userName1234", "userName1234@gamil.com","" }
        };
    }




    @Test(priority = 2,dataProvider = "successTestData")
    public void RegistrationTestPositive(String url, String name, String email, String password) {
        String description = "Registration positive test case";
        OpenPage(url);
        OpenRegistrationPage();
        FillInRegistrationFormSuccess(name,email,password);
        ReportWriter.logTestFinishSuccess(description);
    }

    @Test(priority = 1,dataProvider = "failedTestData")
    public void RegistrationTestNegative(String url, String name, String email, String password) {
        String description = "Registration negative test case";
        OpenPage(url);
        OpenRegistrationPage();
        FillInRegistrationFormFailed(name,email,password);
        ReportWriter.logTestFinishSuccess(description);
    }

}
